package com.ruoyi.bearing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bearing.mapper.BearingModelMapper;
import com.ruoyi.bearing.domain.BearingModel;
import com.ruoyi.bearing.service.IBearingModelService;

/**
 * 轴承型号Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-12
 */
@Service
public class BearingModelServiceImpl implements IBearingModelService 
{
    @Autowired
    private BearingModelMapper bearingModelMapper;

    /**
     * 查询轴承型号
     * 
     * @param bid 轴承型号主键
     * @return 轴承型号
     */
    @Override
    public BearingModel selectBearingModelByBid(String bid)
    {
        return bearingModelMapper.selectBearingModelByBid(bid);
    }

    /**
     * 查询轴承型号列表
     * 
     * @param bearingModel 轴承型号
     * @return 轴承型号
     */
    @Override
    public List<BearingModel> selectBearingModelList(BearingModel bearingModel)
    {
        return bearingModelMapper.selectBearingModelList(bearingModel);
    }

    /**
     * 新增轴承型号
     * 
     * @param bearingModel 轴承型号
     * @return 结果
     */
    @Override
    public int insertBearingModel(BearingModel bearingModel)
    {
        bearingModel.setCreateTime(DateUtils.getNowDate());
        return bearingModelMapper.insertBearingModel(bearingModel);
    }

    /**
     * 修改轴承型号
     * 
     * @param bearingModel 轴承型号
     * @return 结果
     */
    @Override
    public int updateBearingModel(BearingModel bearingModel)
    {
        bearingModel.setUpdateTime(DateUtils.getNowDate());
        return bearingModelMapper.updateBearingModel(bearingModel);
    }

    /**
     * 批量删除轴承型号
     * 
     * @param bids 需要删除的轴承型号主键
     * @return 结果
     */
    @Override
    public int deleteBearingModelByBids(String[] bids)
    {
        return bearingModelMapper.deleteBearingModelByBids(bids);
    }

    /**
     * 删除轴承型号信息
     * 
     * @param bid 轴承型号主键
     * @return 结果
     */
    @Override
    public int deleteBearingModelByBid(String bid)
    {
        return bearingModelMapper.deleteBearingModelByBid(bid);
    }
}
